/**
 * Created by Administrator on 2017/5/16 0016.
 */
define([],function(){
    var tpl={};
    tpl.init = function () {
        var html = '';
        html += historyList();
        return html;
    };
    tpl.init2 = function () {
        var html = '';
        html += userDetails();
        return html;
    };
    tpl.init3 = function () {
        var html = '';
        html += trendsBox();
        return html;
    };
    tpl.init4 = function () {
        var html = '';
        html += printUserDetails();
        return html;
    };
    tpl.init5 = function () {
        var html = '';
        html += loading();
        return html;
    };
    var historyList=function(){
        return '<script id="growthList" type="text/html">' +
                '{{each data as value i}}' +
                '<li growthRecordId="{{value.growthRecordId}}">{{value.createTime}}({{value.testAge}})<span data-id="{{value.growthRecordId}}" class="fa fa-trash-o fa-fw delete"></span></li>'+
                '{{/each}}'+
                '</script>'
    };
    var userDetails=function(){
        return  '<script id="userDetail" type="text/html">' +
                    '<div class="babyInfo">' +
                        '<ul class="clear infoList">'+
                            '<li>姓名<br/>' +
                                '{{if gender=="男"}}'+
                                '<span class=" boyBlue">{{userName}}</span>' +
                                '{{else}}'+
                                '<span class="girlsRed">{{userName}}</span>' +
                                 '{{/if}}'+
                            '</li>'+
                            '<li>性别<br/>' +
                                '{{if gender=="男"}}'+
                                '<span class=" boyBlue">{{gender}}</span>' +
                                '{{else}}'+
                                '<span class="girlsRed">{{gender}}</span>' +
                                '{{/if}}'+
                             '</li>'+
                            '<li>孕周<br/>'+
                                '{{if gender=="男"}}'+
                                '<span class="boyBlue">{{pregnancyDay}}</span>' +
                                '{{else}}'+
                                '<span class="girlsRed">{{pregnancyDay}}</span>' +
                                '{{/if}}'+
                            '</li>'+
                            '{{if pregnancyday < 259}}'+
                                '<li> 纠正年龄<br/>'+
                                    '{{if gender=="男"}}'+
                                    '<span class=" boyBlue">{{correctAge}}</span>' +
                                    '{{else}}'+
                                    '<span class="girlsRed">{{correctAge}}</span>' +
                                    '{{/if}}'+
                                '</li>'+
                                '<li>实际年龄<br/>'+
                                '{{if gender=="男"}}'+
                                '<span class=" boyBlue">{{acturalAge}}</span>' +
                                '{{else}}'+
                                '<span class="girlsRed">{{acturalAge}}</span>' +
                                '{{/if}}'+
                                '</li>'+
                            '{{else}}'+
                                '<li>年龄<br/>'+
                                '{{if gender=="男"}}'+
                                '<span class=" boyBlue">{{acturalAge}}</span>' +
                                '{{else}}'+
                                '<span class="girlsRed">{{acturalAge}}</span>' +
                                '{{/if}}'+
                                '</li>'+
                            '{{/if}}'+
                        '</ul>'+
                    '</div>'+
                    '<div class="babyInfo">'+
                        '<div id="tabToggle">' +
                            '<ul class="ulWidth">'+
                                '{{if pregnancyday < 259}}'+
                                    '{{if gender == "男"}}'+
                                    '<li class="boysTab" type="age">'+
                                        '{{if ageType == "02"}}'+
                                        '<div class="boysTab2 boysTabChecked" ageType="02">'+
                                        '{{else}}'+
                                        '<div class="boysTab2" ageType="02">'+
                                        '{{/if}}'+
                                    '{{else}}'+
                                    '<li class="girlsTab" type="age">'+
                                        '{{if ageType == "02"}}'+
                                        '<div class="girlsTab2 girlsTabChecked" ageType="02">'+
                                        '{{else}}'+
                                        '<div class="girlsTab2" ageType="02">'+
                                        '{{/if}}'+
                                    '{{/if}}'+
                                    '实际年龄</div>'+
                                    '{{if gender == "男"}}'+
                                        '{{if ageType == "01"}}'+
                                        '<div class="boysTabChecked" ageType="01">'+
                                        '{{else}}'+
                                        '<div  ageType="01">'+
                                        '{{/if}}'+
                                    '{{else}}'+
                                        '{{if ageType == "01"}}'+
                                        '<div class="girlsTabChecked" ageType="01">'+
                                        '{{else}}'+
                                        '<div  ageType="01">'+
                                        '{{/if}}'+
                                    '{{/if}}'+
                                    '纠正年龄</div>'+
                                    '</li>'+
                                '{{/if}}'+
                                '{{if gender == "男"}}'+
                                '<li class="boysTab" type="curve">'+
                                    '{{if curveType == "01"}}'+
                                    '<div class="boysTab2 boysTabChecked" curveType="01">'+
                                    '{{else}}'+
                                    '<div class="boysTab2" curveType="01">'+
                                    '{{/if}}'+
                                '{{else}}'+
                                '<li class="girlsTab" type="curve">'+
                                    '{{if curveType == "01"}}'+
                                    '<div class="girlsTab2 girlsTabChecked" curveType = "01">'+
                                    '{{else}}'+
                                    '<div class="girlsTab2" curveType = "01">'+
                                    '{{/if}}'+
                                '{{/if}}'+
                                '百分位曲线图</div>'+
                                '{{if gender == "男"}}'+
                                    '{{if curveType=="02"}}'+
                                    '<div class="boysTabChecked" curveType="02">'+
                                    '{{else}}'+
                                    '<div  curveType="02">'+
                                    '{{/if}}'+
                                '{{else}}'+
                                    '{{if curveType=="02"}}'+
                                    '<div class="girlsTabChecked" curveType="02">'+
                                    '{{else}}'+
                                    '<div  curveType="02">'+
                                    '{{/if}}'+
                                '{{/if}}'+
                                'Z评分曲线图</div>'+
                                '</li>'+
                            '</ul>'+
                        '</div>'+
                        '<ul class="clear babyResult">'+
                            '<li>'+
                                '{{if gender=="男"}}'+
                                '<div class="res-border boyB">'+
                                '{{else}}'+
                                '<div class="res-border girlsB">'+
                                '{{/if}}'+
                                    '<div class="ev-title">整体发育情况</div>'+
                                        '{{if gender=="男" && wLStatus=="0"}}'+
                                        '<font class="ev-res c-boy">{{wLRes}}</font>'+
                                         '{{else if gender=="男" && wLStatus=="1"}}'+
                                        '<font class="ev-res c-warn">{{wLRes}}</font>'+
                                        '{{else if gender=="女" && wLStatus=="0"}}'+
                                        '<font class="ev-res c-girls">{{wLRes}}</font>'+
                                        '{{else if gender=="女" && wLStatus=="1"}}'+
                                        '<font class="ev-res c-warn">{{wLRes}}</font>'+
                                        '{{else}}'+
                                        '<font class="ev-res">{{wLRes}}</font>'+
                                        '{{/if}}'+
                                    '</div>'+
                            '</li>'+
                            '<li>'+
                                '{{if gender=="男"}}'+
                                '<div class="res-border boyB">'+
                                '{{else}}'+
                                '<div class="res-border girlsB">'+
                                '{{/if}}'+
                                    '<div class="ev-title"><span class="heightName"></span></div>'+
                                        '{{if gender=="男" && heightStatus=="0"}}'+
                                        '<font class="ev-res c-boy">{{heightRes}}</font>'+
                                        '{{else if gender=="男" && heightStatus=="1"}}'+
                                        '<font class="ev-res c-warn">{{heightRes}}</font>'+
                                        '{{else if gender=="女" && heightStatus=="0"}}'+
                                        '<font class="ev-res c-girls">{{heightRes}}</font>'+
                                        '{{else if gender=="女" && heightStatus=="1"}}'+
                                        '<font class="ev-res c-warn">{{heightRes}}</font>'+
                                        '{{else}}'+
                                        '<font class="ev-res">{{heightRes}}</font>'+
                                        '{{/if}}'+
                                     '</div>'+
                                    '<div class="clear">'+
                                        '<div {{if gender=="男"}} class="res-left b-boy" {{else}} class="res-left b-girl" {{/if}}>'+
                                            '{{if gender=="男" && heightStatus=="0"}}'+
                                            '<font class="c-boy">{{height}}</font><br/>'+
                                            '{{else if gender=="男" && heightStatus=="1"}}'+
                                            '<font class="c-warn">{{height}}</font><br/>'+
                                            '{{else if gender=="女" && heightStatus=="0"}}'+
                                            '<font class="c-girls">{{height}}</font><br/>'+
                                            '{{else if gender=="女" && heightStatus=="1"}}'+
                                            '<font class="c-warn">{{height}}</font><br/>'+
                                            '{{else if gender=="男" && heightStatus=="3"}}'+
                                            '<font class="c-boy">{{height}}</font><br/>'+
                                            '{{else if gender=="女" && heightStatus=="3"}}'+
                                            '<font class="c-girls">{{height}}</font><br/>'+
                                            '{{/if}}'+
                                            ' <font class="">测量值(cm)</font>'+
                                        '</div>'+
                                    '<div class="res-right">'+
                                        '{{if gender=="男" && heightStatus=="0"}}'+
                                        '<font class="c-boy">{{heightPercent}}</font><br/>'+
                                        '{{else if gender=="男" && heightStatus=="1"}}'+
                                        '<font class="c-warn">{{heightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && heightStatus=="0"}}'+
                                        '<font class="c-girls">{{heightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && heightStatus=="1"}}'+
                                        '<font class="c-warn">{{heightPercent}}</font><br/>'+
                                        '{{else if gender=="男" && heightStatus=="3"}}'+
                                        '<font class="c-boy">{{heightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && heightStatus=="3"}}'+
                                        '<font class="c-girls">{{heightPercent}}</font><br/>'+
                                        '{{/if}}'+
                                        ' <font>{{curveType3}}</font>'+
                                    '</div>'+
                                '</div>'+
                            '</li>'+
                            '<li>'+
                                '{{if gender=="男"}}'+
                                '<div class="res-border boyB">'+
                                '{{else}}'+
                                '<div class="res-border girlsB">'+
                                '{{/if}}'+
                                    '<div class="ev-title">体重</div>'+
                                    '{{if gender=="男" && weightStatus=="0"}}'+
                                    '<font class="ev-res c-boy">{{weightRes}}</font>'+
                                    '{{else if gender=="男" && weightStatus=="1"}}'+
                                    '<font class="ev-res c-warn">{{weightRes}}</font>'+
                                    '{{else if gender=="女" && weightStatus=="0"}}'+
                                    '<font class="ev-res c-girls">{{weightRes}}</font>'+
                                    '{{else if gender=="女" && weightStatus=="1"}}'+
                                    '<font class="ev-res c-warn">{{weightRes}}</font>'+
                                    '{{else}}'+
                                    '<font class="ev-res">{{weightRes}}</font>'+
                                    '{{/if}}'+
                                '</div>'+
                                '<div class="clear">'+
                                    '<div {{if gender=="男"}} class="res-left b-boy" {{else}} class="res-left b-girl" {{/if}}>'+
                                        '{{if gender=="男" && weightStatus=="0"}}'+
                                        '<font class="c-boy">{{weight}}</font><br/>'+
                                        '{{else if gender=="男" && weightStatus=="1"}}'+
                                        '<font class="c-warn">{{weight}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="0"}}'+
                                        '<font class="c-girls">{{weight}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="1"}}'+
                                        '<font class="c-warn">{{weight}}</font><br/>'+
                                        '{{else if gender=="男" && weightStatus=="3"}}'+
                                        '<font class="c-boy">{{weight}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="3"}}'+
                                        '<font class="c-girls">{{weight}}</font><br/>'+
                                        '{{/if}}'+
                                        ' <font class="">测量值(kg)</font>'+
                                    '</div>'+
                                    '<div class="res-right">'+
                                        '{{if gender=="男" && weightStatus=="0"}}'+
                                        '<font class="c-boy">{{weightPercent}}</font><br/>'+
                                        '{{else if gender=="男" && weightStatus=="1"}}'+
                                        '<font class="c-warn">{{weightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="0"}}'+
                                        '<font class="c-girls">{{weightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="1"}}'+
                                        '<font class="c-warn">{{weightPercent}}</font><br/>'+
                                        '{{else if gender=="男" && weightStatus=="3"}}'+
                                        '<font class="c-boy">{{weightPercent}}</font><br/>'+
                                        '{{else if gender=="女" && weightStatus=="3"}}'+
                                        '<font class="c-girls">{{weightPercent}}</font><br/>'+
                                        '{{/if}}'+
                                        ' <font>{{curveType3}}</font>'+
                                    '</div>'+
                                '</div>'+
                            '</li>'+
                            '<li>'+
                                '{{if gender=="男"}}'+
                                '<div class="res-border boyB">'+
                                '{{else}}'+
                                '<div class="res-border girlsB">'+
                                '{{/if}}'+
                                    '<div class="ev-title">头围</div>'+
                                    '{{if gender=="男" && headStatus=="0"}}'+
                                    '<font class="ev-res c-boy">{{headRes}}</font>'+
                                    '{{else if gender=="男" && headStatus=="1"}}'+
                                    '<font class="ev-res c-warn">{{headRes}}</font>'+
                                    '{{else if gender=="女" && headStatus=="0"}}'+
                                    '<font class="ev-res c-girls">{{headRes}}</font>'+
                                    '{{else if gender=="女" && headStatus=="1"}}'+
                                    '<font class="ev-res c-warn">{{headRes}}</font>'+
                                    '{{else}}'+
                                    '<font class="ev-res">{{headRes}}</font>'+
                                    '{{/if}}'+
                                '</div>'+
                                '<div class="clear">'+
                                    '<div {{if gender=="男"}} class="res-left b-boy" {{else}} class="res-left b-girl" {{/if}}>'+
                                        '{{if gender=="男" && headStatus=="0"}}'+
                                        '<font class="c-boy">{{headCircumference}}</font><br/>'+
                                        '{{else if gender=="男" && headStatus=="1"}}'+
                                        '<font class="c-warn">{{headCircumference}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="0"}}'+
                                        '<font class="c-girls">{{headCircumference}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="1"}}'+
                                        '<font class="c-warn">{{headCircumference}}</font><br/>'+
                                        '{{else if gender=="男" && headStatus=="3"}}'+
                                        '<font class="c-boy">{{headCircumference}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="3"}}'+
                                        '<font class="c-girls">{{headCircumference}}</font><br/>'+
                                        '{{/if}}'+
                                        '<font class="">测量值(cm)</font>'+
                                    '</div>'+
                                    '<div class="res-right">'+
                                        '{{if gender=="男" && headStatus=="0"}}'+
                                        '<font class="c-boy">{{headPercent}}</font><br/>'+
                                        '{{else if gender=="男" && headStatus=="1"}}'+
                                        '<font class="c-warn">{{headPercent}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="0"}}'+
                                        '<font class="c-girls">{{headPercent}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="1"}}'+
                                        '<font class="c-warn">{{headPercent}}</font><br/>'+
                                        '{{else if gender=="男" && headStatus=="3"}}'+
                                        '<font class="c-boy">{{headPercent}}</font><br/>'+
                                        '{{else if gender=="女" && headStatus=="3"}}'+
                                        '<font class="c-girls">{{headPercent}}</font><br/>'+
                                        '{{/if}}'+
                                        '<font>{{curveType3}}</font>'+
                                    '</div>'+
                                '</div>'+
                            '</li>'+
                        '</ul>'+
                    '</div>'+
                '<div class="babyInfo" id="babyInfoTrend">' +
                    '{{if curveType2 == "01"}}'+
                        '<ul class="clear trends" id="trends">'+
                            '<li><div class="outfit">WHO(2013)体重发育曲线</div><div id="weight"  {{if gender=="男"}} class="bg boys" {{else}} class="bg girls" {{/if}}></div></li>'+
                            '<li><div class="outfit">WHO(2013)<span class="heightName"></span>发育曲线</div><div id="height" {{if gender=="男"}} class="bg boys" {{else}} class="bg girls" {{/if}}></div></li>'+
                            '<li><div class="outfit">WHO(2013)头围发育曲线</div><div id="head" {{if gender=="男"}} class="bg boys" {{else}} class="bg girls" {{/if}}></div></li>'+
                            '<li><div class="outfit">WHO(2013)<span class="length-weight-age"></span></div><div id="h-wRatio" {{if gender=="男"}} class="bg boys" {{else}} class="bg girls" {{/if}}></div></li>'+
                        '</ul>'+
                    '{{else}}'+
                        '<div class="outfit fetonTitle">Fenton(2013)生长曲线</div>'+
                        '<div id="fetonBox">' +
                        '<div class="fetonTip"><img src="page/department/img/fentongirl_03.jpg" width="100%" height="100%"/></div>'+
                        '<div  id="feton" {{if gender=="男"}} class="bg boys" {{else}} class="bg girls" {{/if}} ></div></div>'+
                    '{{/if}}'+
                '</div>'+
                '<div class="babyInfo">'+
                    '<div class="text-center guideTip"><span class="guide">指导建议</span><span class="pull-right" id="modifyGuides" type="modify"><i class="fa fa-pencil-square-o" aria-hidden="true"></i>修改建议</span></div>'+
                    '<div class="tips" id="tips"></div>'+
                '</div>'+
                '<div class="babyInfo">'+
                    '<div class="text-center guideTip"><span class="guide">备注</span><span class="pull-right" id="modifyRemark" type="modify"><i class="fa fa-pencil-square-o" aria-hidden="true"></i>修改备注</span></div>'+
                    '<div class="tips" id="remark"></div>'+
                '</div>'+
                '<div class="guider">'+
                    '<p class="text-right">指导医生：{{doctorName}}</p>'+
                    '<p class="text-right">指导时间：{{createTime}}</p>'+
                '</div>'+
            '</script>'
    }
    var printUserDetails=function(){
        return  '<script id="printUserDetail-tpl" type="text/html">' +
            '<div class="babyInfo">' +
                '<ul class="clear infoList">'+
                    '<li>姓名<br/><span>{{userName}}</span></li>'+
                    '<li>性别<br/><span>{{gender}}</span></li>'+
                    '<li>孕周<br/><span>{{pregnancyDay}}</span></li>'+
                    '{{if pregnancyday < 259}}'+
                    '<li> 纠正年龄<br/><span>{{correctAge}}</span></li>'+
                    '<li>实际年龄<br/><span>{{acturalAge}}</span></li>'+
                    '{{else}}'+
                    '<li>年龄<br/><span>{{acturalAge}}</span></li>'+
                     '{{/if}}'+
                '</ul>'+
            '</div>'+
            '<div class="babyInfo">'+
            '<ul class="clear babyResult">'+
                '<li>'+
                    '<div class="res-border "><div class="ev-res ev-title">{{wLRes}}</div><div>整体发育情况</div></div>'+
                '</li>'+
                '<li>'+
                    '<div class="res-border ">'+
                        '<div class="ev-title">体重</div><font class="ev-res">{{weightRes}}</font></div>'+
                        '<div class="clear">'+
                            '<div class="res-left"><font >{{weight}}</font><br/><font class="">测量值(kg)</font></div>'+
                            '<div class="res-right"><font >{{weightPercent}}</font><br/><font>{{curveType3}}</font>'+
                        '</div>'+
                    '</div>'+
                '</li>'+
                '<li>'+
                    '<div class="res-border ">'+
                        '<div class="ev-title"><span class="heightName"></span></div><font class="ev-res">{{heightRes}}</font></div>'+
                    '<div class="clear">'+
                        '<div class="res-left"><font >{{height}}</font><br/><font class="">测量值(cm)</font></div>'+
                        '<div class="res-right"><font >{{heightPercent}}</font><br/><font>{{curveType3}}</font></div>'+
                    '</div>'+
                '</li>'+
                '<li>'+
                    '<div class="res-border ">'+
                        '<div class="ev-title">头围</div><font class="ev-res">{{headRes}}</font></div>'+
                        '<div class="clear">'+
                            '<div class="res-left"><font >{{headCircumference}}</font><br/><font class="">测量值(cm)</font></div>'+
                            '<div class="res-right"><font >{{headPercent}}</font><br/><font>{{curveType3}}</font>'+
                        '</div>'+
                    '</div>'+
                '</li>'+
            '</ul>'+
            '</script>'
    }
    var trendsBox=function(){
        return '<script id="trendsBox-tpl" type="text/html">' +
                    '{{if curveType2 == "01"}}'+
                        '<ul class="clear trends" >'+
                            '<li><div class="text-center">(0-5岁)体重发育曲线图</div><div class="bg1"></div></li>'+
                            '<li><div class="text-center">(0-5岁)<span class="heightName"></span>发育曲线图</div><div class="bg2"></div></li>'+
                            '<li><div class="text-center">(0-5岁)头围发育曲线图</div><div class="bg3"></div></li>'+
                            '<li><div class="text-center">(0-5岁)<span class="length-weight-age"></span>图</div><div class="bg4"></div></li>'+
                        '</ul>'+
                    '{{else}}'+
                        '<div class="text-center">Fenton(2013)生长曲线</div>'+
                        '<div class="printFeton"><div  class="fetonBg"></div><img src="page/department/img/fentongirl_03.jpg" width="100%" height="100%"/></div>'+
                    '{{/if}}'+
            '</script>'
    }
    var loading = function(){
        return 	'<script id="tpl_loading" type="text/html">'+
            '	<div class="lc-content-loading">'+
            '		<div class="loader-inner ball-pulse">'+
            '			<div></div>'+
            '			<div></div>'+
            '			<div></div>'+
            '		</div>'+
            '	</div>'+
            '</script>';
    }

    return tpl;
});